export const observeDom = (dom: HTMLElement, fn: () => void) => {
  const observer = new MutationObserver((mutations) => {
    mutations.forEach(() => {
      fn();
    });
  });

  // 开始观察DOM变化
  observer.observe(dom, {
    childList: true,
    subtree: true,
  });
};
